const path = require("path")
const webpackPath = require("./webpack.path.js")

module.exports = {
    mode: 'production',
    target: 'electron-main',
    entry: {
        main:path.join(webpackPath.srcMainPath, "main.ts"),
        preload:path.join(webpackPath.srcPreloadPath, "preload.ts")
    },
    output: {
        filename: '[name].js',
        path: webpackPath.distPath,
    },
    module: {
        rules: [
          {
            test: /\.[jt]sx?$/,
            exclude: /node_modules/,
            use: {
              loader: 'ts-loader',
              options: {
                // Remove this line to enable type checking in webpack builds
                transpileOnly: true,
                compilerOptions: {
                  module: 'esnext',
                },
              },
            },
          },
        ],
      },
      resolve: {
          extensions: ['.js', '.tsx', '.ts', '.jsx'],
      }
}